<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri= "http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false" %>
<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>用户登录</title>

    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" href="css/login.css">
  </head>
  <body>
  
  <div class="container" id="first_div">
      <div class="row">
    
	    <div class="col-sm-offset-4 col-sm-3" id="sec">
	    <a href="./index.html" class="btn btn-default  active" role="button"  id="fir_btn2">
	    	   返回首页
	    </a></div>
	      	<div class="col-sm-4">
	        还没有账号？
	    <a href="./register.html" class="btn btn-default  active" role="button"  id="fir_btn2">
	    	   立即注册
	    </a></div>
      </div>
  </div>
  
  <br><br>
  <div class="container">
      <div class="row">
      	<div class="col-sm-offset-4 col-sm-3"><h1 id="log">用户登录</h1></div>
      </div>
      <div class="row">
      	<div class="col-sm-offset-4 col-sm-3" id="log1">UserLogin</div>
      </div>
  </div>
  <br><br>
  <div class="container">
   <form class="form-horizontal" action="loginServlet"  method="post">
  <div class="form-group">
    <label for="user" class="col-sm-4 control-label">用户名</label>
    <div class="col-sm-5">
      <input type="text" class="form-control" id="user" name="username" placeholder="请输入用户名">
    </div>
  </div>
  <div class="form-group">
    <label for="inputPassword3" class="col-sm-4 control-label">密码</label>
    <div class="col-sm-5">
      <input type="password" class="form-control" id="inputPassword3" name="password" placeholder="请输入密码">
    </div>
  </div>
   <div class="form-group">
    <label for="input" class="col-sm-4 control-label">验证码</label>
    <div class="col-sm-3">
      <input type="text" class="form-control" id="input" name="checkCode" placeholder="请输入验证码">
    </div>
    <div class="col-sm-2">
      <img alt="验证码" src="/maven_web/checkcodeServlet" id="checkcode">
    </div>
  </div>
  <div class="form-group" >
    <div class="col-sm-offset-4 col-sm-3" id="tishi">
      <button type="submit" class="btn btn-default" >登录</button>
    </div>
  </div>
 
</form>
</div>

<div class="container">
 <c:if test="${requestScope.user_error}">
 <div class="alert alert-warning alert-dismissible col-sm-offset-4 col-sm-5" role="alert">
	  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	  <strong>用户名或密码错误！</strong>请检查用户名密码重新输入 
	</div></c:if>
	 <c:if test="${requestScope.check_error}">
 <div class="alert alert-warning alert-dismissible col-sm-offset-4 col-sm-5" role="alert">
	  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	  <strong>验证码错误！</strong>请认真核对并重新输入 
	</div></c:if>
</div>

   <div class="footer">
		Copyright © 2020, <a href="./index.html">&#160&#160嗣食肆&#160</a>&#160All
		Rights Reserved
	</div>

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="js/jquery-3.2.1.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="js/bootstrap.min.js"></script>
    
    
    
  </body>
  
  <script type="text/javascript">
     document.getElementById("checkcode").onclick= function () {
    	
    	 this.src="/maven_web/checkcodeServlet?time="+new Date().getTime();
		
	}
    
  </script>
</html>